package com.ht.medicaltreatment

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.ht.medicaltreatment.utils.DownTimeUtils

class BootReceiver : BroadcastReceiver(){
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent!!.action == "android.intent.action.BOOT_COMPLETED") {
            DownTimeUtils.downTime(3,{
                if(it.toInt() == 0){
                    val toIntent =
                        context!!.packageManager.getLaunchIntentForPackage(context.packageName)
                    context.startActivity(toIntent)
                }
            })
        }
    }
}